package cz.muni.fi.pa165.business.dao;

import cz.muni.fi.pa165.business.entity.Forest;
import java.util.List;

/**
 * Interface defining basic CRUD methods for manipulation with Forest entities
 *
 * @author Matej Cimbora
 */
public interface ForestDAO {

    /**
     * Persists given forest object
     *
     * @param forest - new forest to create
     * @throws IllegalArgumentException if forest is null
     * @throws IllegalArgumentException if forest's id is not null
     */
    public void createForest(Forest forest);

    /**
     * Returns Forest object with given id
     *
     * @param id - id of Forest to be returned
     * @throws IllegalArgumentException if id is null
     * @return Forest object with given id or null if not in DB
     */
    public Forest getForest(Long id);

    /**
     * Updates properties of an existing forest
     *
     * @param forest - forest object with modified attributes
     * @throws IllegalArgumentException if forest is null or database does not
     * contain given forest
     */
    public void updateForest(Forest forest);

    /**
     * Removes a given forest
     *
     * @param forest - forest object to be removed
     * @throws IllegalArgumentException if forest is null or database does not
     * contain given forest
     */
    public void removeForest(Forest forest);

    /**
     * Returns a list of all forest objects
     *
     * @return list of all forests
     */
    public List<Forest> retrieveAllForests();

    /**
     * Returns a forest with given name
     *
     * @param name Name of the forest to search for
     * @return Forest with given name
     * @throws IllegalArgumentException if name is null
     */
    public Forest retrieveForestByName(String name);
}
